package com.blackhorse.mybatis.sqlsession;

import com.blackhorse.mybatis.config.Configuration;
import com.blackhorse.mybatis.utils.XMLConfigBuilder;

import java.io.InputStream;

public class SqlSessionFactoryBuilder {
    //根据配置文件输入流构建工厂
    public SqlSessionFactory build(InputStream is) {
        Configuration cfg = XMLConfigBuilder.loadConfiguration(is);
        return new DefaultSqlSessionFactory(cfg);
    }

}
